package com.syq.utils;

import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

/**
 * @author Sun Yueqi
 * @version 1.00
 * @time 2022/5/25 20:55
 */
public class MyStringUtils {
    static String s="qweqasdaskdyiawhjsdjahk21324832131544132SKJADLKJAKLSDLA";

    public static String creatRandomString(int length){
        List<Character> list = s.chars()
                .mapToObj(c -> (char) c)
                .collect(Collectors.toList());

        Collections.shuffle(list);

        StringBuilder stringBuilder=new StringBuilder();

        for (int i = 0; i <length; i++) {
            Character character=list.get(new Random().nextInt(list.size()));
            stringBuilder.append(character);
            Collections.shuffle(list);
        }
        return stringBuilder.toString();
    }

}
